home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / vim / src / term.h < prev    next >
C/C++ Source or Header  |  1995-03-09  |  16KB  |  866 lines

  1. /* vi:ts=4:sw=4
  2.  *
  3.  * VIM - Vi IMproved        by Bram Moolenaar
  4.  *
  5.  * Read the file "credits.txt" for a list of people who contributed.
  6.  * Read the file "uganda.txt" for copying and usage conditions.
  7.  */
  8.  
  9. /*
  10.  * This file contains the machine dependent escape sequences that the editor
  11.  * needs to perform various operations. Some of the sequences here are
  12.  * optional. Anything not available should be indicated by a null string. In
  13.  * the case of insert/delete line sequences, the editor checks the capability
  14.  * and works around the deficiency, if necessary.
  15.  */
  16.  
  17. #ifdef SASC
  18. /*
  19.  * the SAS C compiler has a bug that makes typedefs being forget sometimes
  20.  */
  21. typedef unsigned char char_u;
  22. #endif
  23.  
  24. /*
  25.  * the terminal capabilities are stored in this structure
  26.  * keep in sync with array in term.c
  27.  */
  28. typedef struct _tcarr
  29. {
  30. /* output codes */
  31.   char_u *t_name;    /* name of this terminal entry */
  32.   char_u *t_el;        /* el       ce    clear to end of line */
  33.   char_u *t_il;        /* il1      al    add new blank line */
  34.   char_u *t_cil;    /* il       AL    add number of blank lines */
  35.   char_u *t_dl;        /* dl1      dl    delete line */
  36.   char_u *t_cdl;    /* dl       DL    delete number of lines */
  37.   char_u *t_cs;        /*          cs    scroll region */
  38.   char_u *t_ed;        /* clear    cl    clear screen */
  39.   char_u *t_ci;        /* civis    vi    cursur invisible */
  40.   char_u *t_cv;        /* cnorm    ve    cursur visible */
  41.   char_u *t_cvv;    /* cvvis    vs  cursor very visible */
  42.   char_u *t_tp;        /* sgr0     me    normal mode */
  43.   char_u *t_ti;        /* rev      mr    reverse mode */
  44.   char_u *t_tb;        /* bold     md    bold mode */
  45.   char_u *t_se;        /* rmso     se    normal mode */
  46.   char_u *t_so;        /* smso     so    standout mode */
  47.   char_u *t_ms;        /* msgr     ms    save to move cursor in reverse mode */
  48.   char_u *t_cm;        /* cup      cm    cursor motion */
  49.   char_u *t_sr;        /* ri       sr    scroll reverse (backward) */
  50.   char_u *t_cri;    /* cuf      RI    cursor number of chars right */
  51.   char_u *t_vb;        /* flash    vb    visual bell */
  52.   char_u *t_ks;        /* smkx     ks    put terminal in "keypad transmit" mode */
  53.   char_u *t_ke;        /* rmkx     ke    out of "keypad transmit" mode */
  54.   char_u *t_ts;        /*          ti    put terminal in termcap mode */
  55.   char_u *t_te;        /*          te    out of termcap mode */
  56.  
  57. /* key codes */
  58.   char_u *t_ku;        /* kcuu1    ku    arrow up */
  59.   char_u *t_kd;        /* kcud1    kd    arrow down */
  60.   char_u *t_kl;        /* kcub1    kl    arrow left */
  61.   char_u *t_kr;        /* kcuf1    kr    arrow right */
  62.   char_u *t_sku;    /* shift arrow up */
  63.   char_u *t_skd;    /* shift arrow down */
  64.   char_u *t_skl;    /* kLFT     #4    shift arrow left */
  65.   char_u *t_skr;    /* kRIT     %    shift arrow right */
  66.   char_u *t_f1;        /* kf1      k1    function key 1 */
  67.   char_u *t_f2;        /* kf2      k2    function key 2 */
  68.   char_u *t_f3;        /* kf3      k3    function key 3 */
  69.   char_u *t_f4;        /* kf4      k4    function key 4 */
  70.   char_u *t_f5;        /* kf5      k5    function key 5 */
  71.   char_u *t_f6;        /* kf6      k6    function key 6 */
  72.   char_u *t_f7;        /* kf7      k7    function key 7 */
  73.   char_u *t_f8;        /* kf8      k8    function key 8 */
  74.   char_u *t_f9;        /* kf9      k9    function key 9 */
  75.   char_u *t_f10;    /* kf10     k;    function key 10 */
  76.   char_u *t_sf1;    /* kf11     F1    shifted function key 1 */
  77.   char_u *t_sf2;    /* kf12     F2    shifted function key 2 */
  78.   char_u *t_sf3;    /* kf13     F3    shifted function key 3 */
  79.   char_u *t_sf4;    /* kf14     F4    shifted function key 4 */
  80.   char_u *t_sf5;    /* kf15     F5    shifted function key 5 */
  81.   char_u *t_sf6;    /* kf16     F6    shifted function key 6 */
  82.   char_u *t_sf7;    /* kf17     F7    shifted function key 7 */
  83.   char_u *t_sf8;    /* kf18     F8    shifted function key 8 */
  84.   char_u *t_sf9;    /* kf19     F9    shifted function key 9 */
  85.   char_u *t_sf10;    /* kf20     FA    shifted function key 10 */
  86.   char_u *t_help;    /* khlp     %1    help key */
  87.   char_u *t_undo;    /* kund     &8    undo key */
  88.   /* adjust inchar() for last key entry! */
  89.  
  90.   char_u *t_csc;    /* -        -    cursor relative to scrolling region */
  91. } Tcarr;
  92.  
  93. extern Tcarr term_strings;    /* currently used terminal strings */
  94.  
  95. /*
  96.  * strings used for terminal
  97.  */
  98. #define T_EL    (term_strings.t_el)
  99. #define T_IL    (term_strings.t_il)
  100. #define T_CIL    (term_strings.t_cil)
  101. #define T_DL    (term_strings.t_dl)
  102. #define T_CDL    (term_strings.t_cdl)
  103. #define T_CS    (term_strings.t_cs)
  104. #define T_ED    (term_strings.t_ed)
  105. #define T_CI    (term_strings.t_ci)
  106. #define T_CV    (term_strings.t_cv)
  107. #define T_CVV    (term_strings.t_cvv)
  108. #define T_TP    (term_strings.t_tp)
  109. #define T_TI    (term_strings.t_ti)
  110. #define T_TB    (term_strings.t_tb)
  111. #define T_SE    (term_strings.t_se)
  112. #define T_SO    (term_strings.t_so)
  113. #define T_MS    (term_strings.t_ms)
  114. #define T_CM    (term_strings.t_cm)
  115. #define T_SR    (term_strings.t_sr)
  116. #define T_CRI    (term_strings.t_cri)
  117. #define T_VB    (term_strings.t_vb)
  118. #define T_KS    (term_strings.t_ks)
  119. #define T_KE    (term_strings.t_ke)
  120. #define T_TS    (term_strings.t_ts)
  121. #define T_TE    (term_strings.t_te)
  122. #define T_CSC    (term_strings.t_csc)
  123.  
  124.  
  125. #ifndef TERMINFO
  126. # ifndef NO_BUILTIN_TCAPS
  127. /*
  128.  * here are the builtin termcap entries.
  129.  * They not stored as complete Tcarr structures, as such a structure 
  130.  * is to big. 
  131.  * Each termcap is a concatenated string of entries, where '\0' characters
  132.  * followed by a skip character sepereate the capabilities. The skip 
  133.  * character is the relative structure offset for the following entry.
  134.  * See parse_builtin_tcap() in term.c for all details.
  135.  */
  136. #  define AMIGA_TCAP "amiga\0\
  137. \0\033[K\0\
  138. \0\033[L\0\
  139. \0\033[%dL\0\
  140. \0\033[M\0\
  141. \0\033[%dM\0\
  142. \1\014\0\
  143. \0\033[0 p\0\
  144. \0\033[1 p\0\
  145. \1\033[0m\0\
  146. \0\033[7m\0\
  147. \0\033[1m\0\
  148. \0\033[0m\0\
  149. \0\033[33m\0\
  150. \0\001\0\
  151. \0\033[%i%d;%dH\0\
  152. \1\033[%dC\0\
  153. \5\233A\0\
  154. \0\233B\0\
  155. \0\233D\0\
  156. \0\233C\0\
  157. \0\233T\0\
  158. \0\233S\0\
  159. \0\233 A\0\
  160. \0\233 @\0\
  161. \0\233\060~\0\
  162. \0\233\061~\0\
  163. \0\233\062~\0\
  164. \0\233\063~\0\
  165. \0\233\064~\0\
  166. \0\233\065~\0\
  167. \0\233\066~\0\
  168. \0\233\067~\0\
  169. \0\233\070~\0\
  170. \0\233\071~\0\
  171. \0\233\061\060~\0\
  172. \0\233\061\061~\0\
  173. \0\233\061\062~\0\
  174. \0\233\061\063~\0\
  175. \0\233\061\064~\0\
  176. \0\233\061\065~\0\
  177. \0\233\061\066~\0\
  178. \0\233\061\067~\0\
  179. \0\233\061\070~\0\
  180. \0\233\061\071~\0\
  181. \0\233?~\0\
  182. \0\0"
  183.  
  184. #  define ATARI_TCAP "atari\0\
  185. \0\033l\0\
  186. \0\033L\0\
  187. \1\033M\0\
  188. \2\033E\0\
  189. \0\033f\0\
  190. \0\033e\0\
  191. \0\0"
  192.  
  193. #  define ANSI_TCAP "ansi\0\
  194. \0\033[2K\0\
  195. \0\033[L\0\
  196. \0\033[%dL\0\
  197. \0\033[M\0\
  198. \0\033[%dM\0\
  199. \1\033[2J\0\
  200. \3\033[0m\0\
  201. \0\033[7m\0\
  202. \3\001\0\
  203. \0\033[%i%d;%dH\0\
  204. \1\033[%dC\0\
  205. \0\0"
  206.  
  207. /*
  208.  * These codes are valid when nansi.sys or equivalent has been installed.
  209.  * Function keys on a PC are preceded with a NUL. These are converted into
  210.  * K_NUL '\316' in GetChars(), because we cannot handle NULs in key codes.
  211.  * CTRL-arrow is used instead of SHIFT-arrow.
  212.  */
  213. #  define PCANSI_TCAP "pcansi\0\
  214. \0\033[K\0\
  215. \0\033[L\0\
  216. \1\033[M\0\
  217. \2\033[2J\0\
  218. \3\033[0m\0\
  219. \0\033[7m\0\
  220. \3\001\0\
  221. \0\033[%i%d;%dH\0\
  222. \1\033[%dC\0\
  223. \5\316H\0\
  224. \0\316P\0\
  225. \0\316K\0\
  226. \0\316M\0\
  227. \2\316s\0\
  228. \0\316t\0\
  229. \0\316;\0\
  230. \0\316<\0\
  231. \0\316=\0\
  232. \0\316>\0\
  233. \0\316?\0\
  234. \0\316@\0\
  235. \0\316A\0\
  236. \0\316B\0\
  237. \0\316C\0\
  238. \0\316D\0\
  239. \0\316T\0\
  240. \0\316U\0\
  241. \0\316V\0\
  242. \0\316W\0\
  243. \0\316X\0\
  244. \0\316Y\0\
  245. \0\316Z\0\
  246. \0\316[\0\
  247. \0\316\\\0\
  248. \0\316]\0\
  249. \0\0"
  250.  
  251. /*
  252.  * These codes are valid for the pc video.
  253.  * The entries that start with ESC | are translated into conio calls in msdos.c.
  254.  */
  255. #  define PCTERM_TCAP "pcterm\0\
  256. \0\033|K\0\
  257. \0\033|L\0\
  258. \1\033|M\0\
  259. \1\033|%i%d;%dr\0\
  260. \0\033|J\0\
  261. \3\033|0m\0\
  262. \0\033|112m\0\
  263. \0\033|63m\0\
  264. \0\033|0m\0\
  265. \0\033|31m\0\
  266. \0\001\0\
  267. \0\033|%i%d;%dH\0\
  268. \7\316H\0\
  269. \0\316P\0\
  270. \0\316K\0\
  271. \0\316M\0\
  272. \2\316s\0\
  273. \0\316t\0\
  274. \0\316;\0\
  275. \0\316<\0\
  276. \0\316=\0\
  277. \0\316>\0\
  278. \0\316?\0\
  279. \0\316@\0\
  280. \0\316A\0\
  281. \0\316B\0\
  282. \0\316C\0\
  283. \0\316D\0\
  284. \0\316T\0\
  285. \0\316U\0\
  286. \0\316V\0\
  287. \0\316W\0\
  288. \0\316X\0\
  289. \0\316Y\0\
  290. \0\316Z\0\
  291. \0\316[\0\
  292. \0\316\\\0\
  293. \0\316]\0\
  294. \0\0"
  295.  
  296. /*
  297.  * These codes are valid for the NT Console 
  298.  * The entries that start with ESC | are translated into console calls 
  299.  * in winnt.c.
  300.  */
  301. #  define NTCONSOLE_TCAP "ntconsole\0\
  302. \0\033|K\0\
  303. \0\033|L\0\
  304. \0\033|%dL\0\
  305. \0\033|M\0\
  306. \0\033|%dM\0\
  307. \1\033|J\0\
  308. \0\033|v\0\
  309. \0\033|V\0\
  310. \1\033|0m\0\
  311. \0\033|112m\0\
  312. \0\033|63m\0\
  313. \0\033|0m\0\
  314. \0\033|31m\0\
  315. \0\001\0\
  316. \0\033|%i%d;%dH\0\
  317. \7\316H\0\
  318. \0\316P\0\
  319. \0\316K\0\
  320. \0\316M\0\
  321. \2\316s\0\
  322. \0\316t\0\
  323. \0\316;\0\
  324. \0\316<\0\
  325. \0\316=\0\
  326. \0\316>\0\
  327. \0\316?\0\
  328. \0\316@\0\
  329. \0\316A\0\
  330. \0\316B\0\
  331. \0\316C\0\
  332. \0\316D\0\
  333. \0\316T\0\
  334. \0\316U\0\
  335. \0\316V\0\
  336. \0\316W\0\
  337. \0\316X\0\
  338. \0\316Y\0\
  339. \0\316Z\0\
  340. \0\316[\0\
  341. \0\316\\\0\
  342. \0\316]\0\
  343. \0\0"
  344.  
  345.  
  346. #  define VT52_TCAP "vt52\0\
  347. \0\033K\0\
  348. \0\033T\0\
  349. \1\033U\0\
  350. \2\014\0\
  351. \3\033SO\0\
  352. \0\033S2\0\
  353. \3\001\0\
  354. \0\033Y%+ %+ \0\
  355. \0\0"
  356.  
  357. /*
  358.  * The xterm termcap is missing F14 and F15, because they send the same
  359.  * codes as the undo and help key, although they don't work on all keyboards.
  360.  */
  361. #  define XTERM_TCAP "xterm\0\
  362. \0\033[K\0\
  363. \0\033[L\0\
  364. \0\033[%dL\0\
  365. \0\033[M\0\
  366. \0\033[%dM\0\
  367. \0\033[%i%d;%dr\0\
  368. \0\033[H\033[2J\0\
  369. \3\033[m\0\
  370. \0\033[7m\0\
  371. \0\033[1m\0\
  372. \2\001\0\
  373. \0\033[%i%d;%dH\0\
  374. \0\033M\0\
  375. \0\033[%dC\0\
  376. \1\033[?1h\033=\0\
  377. \0\033[?1l\033>\0\
  378. \0\0337\033[?47h\0\
  379. \0\033[2J\033[?47l\0338\0\
  380. \0\033OA\0\
  381. \0\033OB\0\
  382. \0\033OD\0\
  383. \0\033OC\0\
  384. \0\033Ox\0\
  385. \0\033Or\0\
  386. \0\033Ot\0\
  387. \0\033Ov\0\
  388. \0\033[11~\0\
  389. \0\033[12~\0\
  390. \0\033[13~\0\
  391. \0\033[14~\0\
  392. \0\033[15~\0\
  393. \0\033[17~\0\
  394. \0\033[18~\0\
  395. \0\033[19~\0\
  396. \0\033[20~\0\
  397. \0\033[21~\0\
  398. \0\033[23~\0\
  399. \0\033[24~\0\
  400. \0\033[25~\0\
  401. \2\033[29~\0\
  402. \0\033[31~\0\
  403. \0\033[32~\0\
  404. \0\033[33~\0\
  405. \0\033[34~\0\
  406. \0\033[28~\0\
  407. \0\033[26~\0\
  408. \0\0"
  409.  
  410. #  define DEBUG_TCAP "debug\0\
  411. \0[EL]\0\
  412. \0[IL]\0\
  413. \0[CIL%d]\0\
  414. \0[DL]\0\
  415. \0[CDL%d]\0\
  416. \0[%dCS%d]\0\
  417. \0[ED]\0\
  418. \0[CI]\0\
  419. \0[CV]\0\
  420. \0[CVV]\0\
  421. \0[TP]\0\
  422. \0[TI]\0\
  423. \0[TB]\0\
  424. \0[SE]\0\
  425. \0[SO]\0\
  426. \0[MS]\0\
  427. \0[%dCM%d]\0\
  428. \0[SR]\0\
  429. \0[CRI%d]\0\
  430. \0[VB]\0\
  431. \0[KS]\0\
  432. \0[KE]\0\
  433. \0[TI]\0\
  434. \0[TE]\0\
  435. \0[KU]\0\
  436. \0[KD]\0\
  437. \0[KL]\0\
  438. \0[KR]\0\
  439. \0[SKU]\0\
  440. \0[SKD]\0\
  441. \0[SKL]\0\
  442. \0[SKR]\0\
  443. \0[F1]\0\
  444. \0[F2]\0\
  445. \0[F3]\0\
  446. \0[F4]\0\
  447. \0[F5]\0\
  448. \0[F6]\0\
  449. \0[F7]\0\
  450. \0[F8]\0\
  451. \0[F9]\0\
  452. \0[F10]\0\
  453. \0[SF1]\0\
  454. \0[SF2]\0\
  455. \0[SF3]\0\
  456. \0[SF4]\0\
  457. \0[SF5]\0\
  458. \0[SF6]\0\
  459. \0[SF7]\0\
  460. \0[SF8]\0\
  461. \0[SF9]\0\
  462. \0[SF10]\0\
  463. \0[HELP]\0\
  464. \0[UNDO]\0\
  465. \0\0"
  466.  
  467. #  ifdef ATARI
  468. #   define DFLT_TCAP ATARI_TCAP
  469. #  endif /* ATARI */
  470.  
  471. #  ifdef AMIGA
  472. #   define DFLT_TCAP AMIGA_TCAP
  473. #  endif /* AMIGA */
  474.  
  475. #  ifdef NT
  476. #   define DFLT_TCAP NTCONSOLE_TCAP
  477. #  else
  478. #   ifdef MSDOS
  479. #    define DFLT_TCAP PCTERM_TCAP                       
  480. #   endif /* MSDOS */                                   
  481. #  endif /* NT */ 
  482.  
  483. #  ifdef UNIX
  484. #   define DFLT_TCAP ANSI_TCAP
  485. #  endif /* UNIX */
  486.  
  487. # else /* NO_BUILTIN_TCAPS */
  488. #  define DUMB_TCAP "dumb\0\
  489. \6\014\0\
  490. \9\033[%i%d;%dH\0\
  491. \0\0"
  492. # endif /* NO_BUILTIN_TCAPS */
  493.  
  494. #else /* TERMINFO */
  495. # ifndef NO_BUILTIN_TCAPS
  496. /*
  497.  * here are the builtin termcap entries.
  498.  * They not stored as complete Tcarr structures, as such a structure 
  499.  * is to big. 
  500.  * Each termcap is a concatenated string of entries, where '\0' characters
  501.  * followed by a skip character sepereate the capabilities. The skip 
  502.  * character is the relative structure offset for the following entry.
  503.  * See parse_builtin_tcap() in term.c for all details.
  504.  */
  505. #  define AMIGA_TCAP "amiga\0\
  506. \0\033[K\0\
  507. \0\033[L\0\
  508. \0\033[%p1%dL\0\
  509. \0\033[M\0\
  510. \0\033[%p1%dM\0\
  511. \1\014\0\
  512. \0\033[0 p\0\
  513. \0\033[1 p\0\
  514. \1\033[0m\0\
  515. \0\033[7m\0\
  516. \0\033[1m\0\
  517. \0\033[0m\0\
  518. \0\033[33m\0\
  519. \0\001\0\
  520. \0\033[%i%p1%d;%p2%dH\0\
  521. \1\033[%p1%dC\0\
  522. \5\233A\0\
  523. \0\233B\0\
  524. \0\233D\0\
  525. \0\233C\0\
  526. \0\233T\0\
  527. \0\233S\0\
  528. \0\233 A\0\
  529. \0\233 @\0\
  530. \0\233\060~\0\
  531. \0\233\061~\0\
  532. \0\233\062~\0\
  533. \0\233\063~\0\
  534. \0\233\064~\0\
  535. \0\233\065~\0\
  536. \0\233\066~\0\
  537. \0\233\067~\0\
  538. \0\233\070~\0\
  539. \0\233\071~\0\
  540. \0\233\061\060~\0\
  541. \0\233\061\061~\0\
  542. \0\233\061\062~\0\
  543. \0\233\061\063~\0\
  544. \0\233\061\064~\0\
  545. \0\233\061\065~\0\
  546. \0\233\061\066~\0\
  547. \0\233\061\067~\0\
  548. \0\233\061\070~\0\
  549. \0\233\061\071~\0\
  550. \0\233?~\0\
  551. \0\0"
  552.  
  553. #  define ATARI_TCAP "atari\0\
  554. \0\033l\0\
  555. \0\033L\0\
  556. \1\033M\0\
  557. \2\033E\0\
  558. \0\033f\0\
  559. \0\033e\0\
  560. \0\0"
  561.  
  562. #  define ANSI_TCAP "ansi\0\
  563. \0\033[2K\0\
  564. \0\033[L\0\
  565. \0\033[%p1%dL\0\
  566. \0\033[M\0\
  567. \0\033[%p1%dM\0\
  568. \1\033[2J\0\
  569. \3\033[0m\0\
  570. \0\033[7m\0\
  571. \3\001\0\
  572. \0\033[%i%p1%d;%p2%dH\0\
  573. \1\033[%p1%dC\0\
  574. \0\0"
  575.  
  576. /*
  577.  * These codes are valid when nansi.sys or equivalent has been installed.
  578.  * Function keys on a PC are preceded with a NUL. These are converted into
  579.  * K_NUL '\316' in GetChars(), because we cannot handle NULs in key codes.
  580.  * CTRL-arrow is used instead of SHIFT-arrow.
  581.  */
  582. #  define PCANSI_TCAP "pcansi\0\
  583. \0\033[K\0\
  584. \0\033[L\0\
  585. \1\033[M\0\
  586. \2\033[2J\0\
  587. \3\033[0m\0\
  588. \0\033[7m\0\
  589. \3\001\0\
  590. \0\033[%i%p1%d;%p2%dH\0\
  591. \1\033[%p1%dC\0\
  592. \5\316H\0\
  593. \0\316P\0\
  594. \0\316K\0\
  595. \0\316M\0\
  596. \2\316s\0\
  597. \0\316t\0\
  598. \0\316;\0\
  599. \0\316<\0\
  600. \0\316=\0\
  601. \0\316>\0\
  602. \0\316?\0\
  603. \0\316@\0\
  604. \0\316A\0\
  605. \0\316B\0\
  606. \0\316C\0\
  607. \0\316D\0\
  608. \0\316T\0\
  609. \0\316U\0\
  610. \0\316V\0\
  611. \0\316W\0\
  612. \0\316X\0\
  613. \0\316Y\0\
  614. \0\316Z\0\
  615. \0\316[\0\
  616. \0\316\\\0\
  617. \0\316]\0\
  618. \0\0"
  619.  
  620. /*
  621.  * These codes are valid for the pc video.
  622.  * The entries that start with ESC | are translated into conio calls in msdos.c.
  623.  */
  624. #  define PCTERM_TCAP "pcterm\0\
  625. \0\033|K\0\
  626. \0\033|L\0\
  627. \1\033|M\0\
  628. \1\033|%i%p1%d;%p2%dr\0\
  629. \0\033|J\0\
  630. \3\033|0m\0\
  631. \0\033|112m\0\
  632. \0\033|63m\0\
  633. \0\033|0m\0\
  634. \0\033|31m\0\
  635. \0\001\0\
  636. \0\033|%i%p1%d;%p2%dH\0\
  637. \7\316H\0\
  638. \0\316P\0\
  639. \0\316K\0\
  640. \0\316M\0\
  641. \2\316s\0\
  642. \0\316t\0\
  643. \0\316;\0\
  644. \0\316<\0\
  645. \0\316=\0\
  646. \0\316>\0\
  647. \0\316?\0\
  648. \0\316@\0\
  649. \0\316A\0\
  650. \0\316B\0\
  651. \0\316C\0\
  652. \0\316D\0\
  653. \0\316T\0\
  654. \0\316U\0\
  655. \0\316V\0\
  656. \0\316W\0\
  657. \0\316X\0\
  658. \0\316Y\0\
  659. \0\316Z\0\
  660. \0\316[\0\
  661. \0\316\\\0\
  662. \0\316]\0\
  663. \0\0"
  664.  
  665. /*
  666.  * These codes are valid for the NT Console 
  667.  * The entries that start with ESC | are translated into console calls 
  668.  * in winnt.c.
  669.  */
  670. #  define NTCONSOLE_TCAP "ntconsole\0\
  671. \0\033|K\0\
  672. \0\033|L\0\
  673. \0\033|%dL\0\
  674. \0\033|M\0\
  675. \0\033|%dM\0\
  676. \1\033|J\0\
  677. \0\033|v\0\
  678. \0\033|V\0\
  679. \1\033|0m\0\
  680. \0\033|112m\0\
  681. \0\033|63m\0\
  682. \0\033|0m\0\
  683. \0\033|31m\0\
  684. \0\001\0\
  685. \0\033|%i%p1%d;%p2%dH\0\
  686. \7\316H\0\
  687. \0\316P\0\
  688. \0\316K\0\
  689. \0\316M\0\
  690. \2\316s\0\
  691. \0\316t\0\
  692. \0\316;\0\
  693. \0\316<\0\
  694. \0\316=\0\
  695. \0\316>\0\
  696. \0\316?\0\
  697. \0\316@\0\
  698. \0\316A\0\
  699. \0\316B\0\
  700. \0\316C\0\
  701. \0\316D\0\
  702. \0\316T\0\
  703. \0\316U\0\
  704. \0\316V\0\
  705. \0\316W\0\
  706. \0\316X\0\
  707. \0\316Y\0\
  708. \0\316Z\0\
  709. \0\316[\0\
  710. \0\316\\\0\
  711. \0\316]\0\
  712. \0\0"
  713.  
  714.  
  715. #  define VT52_TCAP "vt52\0\
  716. \0\033K\0\
  717. \0\033T\0\
  718. \1\033U\0\
  719. \2\014\0\
  720. \3\033SO\0\
  721. \0\033S2\0\
  722. \3\001\0\
  723. \0\033Y%+ %+ \0\
  724. \0\0"
  725.  
  726. /*
  727.  * The xterm termcap is missing F14 and F15, because they send the same
  728.  * codes as the undo and help key, although they don't work on all keyboards.
  729.  */
  730. #  define XTERM_TCAP "xterm\0\
  731. \0\033[K\0\
  732. \0\033[L\0\
  733. \0\033[%p1%dL\0\
  734. \0\033[M\0\
  735. \0\033[%p1%dM\0\
  736. \0\033[%i%p1%d;%p2%dr\0\
  737. \0\033[H\033[2J\0\
  738. \3\033[m\0\
  739. \0\033[7m\0\
  740. \3\001\0\
  741. \0\033[%i%p1%d;%p2%dH\0\
  742. \0\033M\0\
  743. \0\033[%p1%dC\0\
  744. \1\033[?1h\033=\0\
  745. \0\033[?1l\033>\0\
  746. \0\0337\033[?47h\0\
  747. \0\033[2J\033[?47l\0338\0\
  748. \0\033OA\0\
  749. \0\033OB\0\
  750. \0\033OD\0\
  751. \0\033OC\0\
  752. \0\033Ox\0\
  753. \0\033Or\0\
  754. \0\033Ot\0\
  755. \0\033Ov\0\
  756. \0\033[11~\0\
  757. \0\033[12~\0\
  758. \0\033[13~\0\
  759. \0\033[14~\0\
  760. \0\033[15~\0\
  761. \0\033[17~\0\
  762. \0\033[18~\0\
  763. \0\033[19~\0\
  764. \0\033[20~\0\
  765. \0\033[21~\0\
  766. \0\033[23~\0\
  767. \0\033[24~\0\
  768. \0\033[25~\0\
  769. \2\033[29~\0\
  770. \0\033[31~\0\
  771. \0\033[32~\0\
  772. \0\033[33~\0\
  773. \0\033[34~\0\
  774. \0\033[28~\0\
  775. \0\033[26~\0\
  776. \0\0"
  777.  
  778. #  define DEBUG_TCAP "debug\0\
  779. \0[EL]\0\
  780. \0[IL]\0\
  781. \0[CIL%p1%d]\0\
  782. \0[DL]\0\
  783. \0[CDL%p1%d]\0\
  784. \0[%p1%dCS%p2%d]\0\
  785. \0[ED]\0\
  786. \0[CI]\0\
  787. \0[CV]\0\
  788. \0[CVV]\0\
  789. \0[TP]\0\
  790. \0[TI]\0\
  791. \0[TB]\0\
  792. \0[SE]\0\
  793. \0[SO]\0\
  794. \0[MS]\0\
  795. \0[%p1%dCM%p2%d]\0\
  796. \0[SR]\0\
  797. \0[CRI%p1%d]\0\
  798. \0[VB]\0\
  799. \0[KS]\0\
  800. \0[KE]\0\
  801. \0[TI]\0\
  802. \0[TE]\0\
  803. \0[KU]\0\
  804. \0[KD]\0\
  805. \0[KL]\0\
  806. \0[KR]\0\
  807. \0[SKU]\0\
  808. \0[SKD]\0\
  809. \0[SKL]\0\
  810. \0[SKR]\0\
  811. \0[F1]\0\
  812. \0[F2]\0\
  813. \0[F3]\0\
  814. \0[F4]\0\
  815. \0[F5]\0\
  816. \0[F6]\0\
  817. \0[F7]\0\
  818. \0[F8]\0\
  819. \0[F9]\0\
  820. \0[F10]\0\
  821. \0[SF1]\0\
  822. \0[SF2]\0\
  823. \0[SF3]\0\
  824. \0[SF4]\0\
  825. \0[SF5]\0\
  826. \0[SF6]\0\
  827. \0[SF7]\0\
  828. \0[SF8]\0\
  829. \0[SF9]\0\
  830. \0[SF10]\0\
  831. \0[HELP]\0\
  832. \0[UNDO]\0\
  833. \0\0"
  834.  
  835. #  ifdef ATARI
  836. #   define DFLT_TCAP ATARI_TCAP
  837. #  endif /* ATARI */
  838.  
  839. #  ifdef AMIGA
  840. #   define DFLT_TCAP AMIGA_TCAP
  841. #  endif /* AMIGA */
  842.  
  843. #  ifdef NT
  844. #   define DFLT_TCAP NTCONSOLE_TCAP
  845. #  else
  846. #   ifdef MSDOS
  847. #    define DFLT_TCAP PCTERM_TCAP                       
  848. #   endif /* MSDOS */                                   
  849. #  endif /* NT */ 
  850.  
  851. #  ifdef UNIX
  852. #   define DFLT_TCAP ANSI_TCAP
  853. #  endif /* UNIX */
  854.  
  855. # else /* NO_BUILTIN_TCAPS */
  856. /*
  857.  * The most minimal terminal: only clear screen and cursor positioning
  858.  */
  859. #  define DUMB_TCAP "dumb\0\
  860. \6\014\0\
  861. \9\033[%i%p1%d;%p2%dH\0\
  862. \0\0"
  863. # endif /* NO_BUILTIN_TCAPS */
  864.  
  865. #endif
  866.